/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package 解析.node.charproperty.支持补集;

/**
 *
 * @author yanxi
 */
public class Category extends CharProperty支持补集 {

    public final int typeMask;

    public Category(int typeMask) {
        this.typeMask = typeMask; 
    }
    
    @Override
    public boolean isSatisfiedBy正集(int ch) {
        return (typeMask & (1 << Character.getType(ch))) != 0;
    }

    @Override
    public String toString正集() {
        return "\\p{"+CharPropertyNames.mapCategory.get(typeMask)+"}";
    }

    @Override
    public String toString补集() {
        return "\\P{"+CharPropertyNames.mapCategory.get(typeMask)+"}";
    }
}
